<template>
    <el-form-item label="规格设置" >
        <table class="border">
            <thead>
                <tr>
                    <th v-for="(th,thi) in tableThs" :key="thi" class="border" :width="th.width" :rowspan="th.rowspan" :colspan="th.colspan">
                        {{ th.name }}
                    </th>
                </tr>
                <tr>
                    <th v-for="(th,thi) in skuLabels" :key="thi" >
                        {{ th.name }}
                    </th>
                </tr>
            </thead>
        </table>
        <tbody>
            <tr v-for="(item,index) in sku_list" :key="index">
                <td width="100" class="border text-center" v-for="(sku,skui) in item.skus" :key="skui">{{ sku.value }}</td>
                <td class="boder" width="100">
                    <el-input v-model="item.pprice" size="small " type="name"></el-input>
                </td>
                <td class="boder" width="100">
                    <el-input v-model="item.oprice" size="small " type="name"></el-input>
                </td>
                <td class="boder" width="100">
                    <el-input v-model="item.cprice" size="small " type="name"></el-input>
                </td>
                <td class="boder" width="100">
                    <el-input v-model="item.stock" size="small " type="name"></el-input> 
                </td>
                <td class="boder" width="100">
                    <el-input v-model="item.volume" size="small " type="name"></el-input> 
                </td>
                <td class="boder" width="100">
                    <el-input v-model="item.weight" size="small " type="name"></el-input> 
                </td>
                <td class="boder" width="100">
                    <el-input v-model="item.code" size="small " ></el-input> 
                </td>
            </tr>
        </tbody>
    </el-form-item>
    
</template>

<script setup>
import { initSkuTable } from '~/composables/useSku.js'
const {
    skuLabels,
    tableThs,
    sku_list } = initSkuTable()
</script>